#ifndef CDATAMGR_H
#define CDATAMGR_H
//--------------------------------------------------------------
//  Author: Kebal
//  Date:   6-6-13
//  Desc:   Manager for loading, saving and manipulating
//          Customers, orders and address data.
//--------------------------------------------------------------
//------------------------
//  Includes
//------------------------
#include <QString>

#include "Globals.h"


//------------------------
//  Class
//------------------------
class   CDataMgr
{
public:
    CDataMgr();
    virtual ~CDataMgr();

    //---------------------------------
    //  Loaders
    //---------------------------------
    void    LoadStreets();                  //  Load street data from file
    void    LoadAddress();                  //  Load address data from file
    void    LoadCustomers();                //  Load customer data from file
    void    LoadProducts();                 //  Load products data from file
    void    LoadLineItems();                //  Load line items data from file
    void    LoadOrders();                   //  Load orders data from file


    //---------------------------------
    //  Savers
    //---------------------------------
    void    SaveStreets();                  //  Save street data to file
    void    SaveAddress();                  //  Save address data to file
    void    SaveCustomers();                //  Save customer data to file
    void    SaveProducts();                 //  Save products data to file
    void    SaveLineItems();                //  Save line items data to file
    void    SaveOrders();                   //  Save orders data to file


    //---------------------------------
    //  Get Data
    //---------------------------------
    QList<LPADDRESS>    GetAddress();       //  returns list of address's that WANT a catalogue
    QList<LPADDRESS>    GetALLAddress();    //  returns list of ALL address's

    QList<LPCUSTOMER>   GetCustomers();     //  returns list of customers

    QList<LPPRODUCT>    GetProducts();      //  returns list of products
    QList<LPORDER>      GetOrders();        //  returns list of orders

    QList<LPLINEITEM>   GetLineItems();     //  return list of line items
    QList<LPSTREET>     GetStreets();       //  return list of streets

    LPSTREET            GetStreet( int StreetID );  //  return specific street
    LPLINEITEM          GetLineItem( int LineItemID );  //  return specific line item

    LPCUSTOMER          GetCustomer( int CustomerID );  //  return specific customer
    LPCUSTOMER          GetCustomer( QString sFirstname );


private:
    QList<LPSTREET>         m_pStreets;     //  list of street data
    QList<LPADDRESS>        m_pAddress;     //  list of address data
    QList<LPCUSTOMER>       m_pCustomers;   //  list of customer data
    QList<LPPRODUCT>        m_pProducts;    //  list of products data
    QList<LPLINEITEM>       m_pLineItems;   //  list of line items data
    QList<LPORDER>          m_pOrders;      //  list of orders data
};

#endif // CDATAMGR_H
